#include "webviewdlg.h"
#include "ui_webviewdlg.h"
//#include <QWebEngineView>
//#include <QUrl>
#include <QDesktopServices>

WebviewDlg::WebviewDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::WebviewDlg)
{
    ui->setupUi(this);

    resize(1024, 768);

//    QWebEngineView *LiveView = new QWebEngineView;
//    LiveView->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
//    LiveView->setAttribute(Qt::WA_DeleteOnClose);
//    LiveView->load(QUrl("https://blog.csdn.net/qq_36651243"));
//    //LiveView->setWindowFlags(Qt::FramelessWindowHint);   //去除边框
//    //LiveView->setAttribute(Qt::WA_TranslucentBackground, true); //透明
//    LiveView->resize(1024, 768);
//    LiveView->show();


//     ui->textBrowser->setOpenLinks(false);
//     connect(ui->textBrowser, SIGNAL(anchorClicked(const QUrl&)),this, SLOT(open(const QUrl&)));

    QDesktopServices::openUrl(QUrl("http://127.0.0.1:8083/index/home/zjlkanban"));

}

WebviewDlg::~WebviewDlg()
{
    delete ui;
}

void WebviewDlg::open(const QUrl& url)
{
    qDebug("open url: %s",url.toString().toStdString().data());
    QDesktopServices::openUrl(url);
}
